<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	  <title>会员中心-我的留言-{siteseo name='title'}</title>
	  <meta name="keywords" content="{siteseo name='keyword'}" />
      <meta name="description" content="{siteseo name='descri'}" />
	  <link href="__USERST__static/css/member_index.css" rel="stylesheet" type="text/css">
	  <script type="text/javascript" src="__USERST__static/js/jquery-1.8.2.min.js"></script>
	  <script type="text/javascript" src="__USERST__static/layer/layer.js"></script>
	  <link rel="stylesheet" href="__USERST__static/layer/theme/default/layer.css?v=3.1.1" id="layuicss-layer">
	  <link href="__USERST__static/icon/iconfont.css" rel="stylesheet" type="text/css" />
  </head>
<!--头部-->
{include file='member_temp/user/header'}
<!--头部end-->
<div class="yzm_member_container main">
   <!--侧边导航栏开始-->
      {include file='member_temp/user/menu'}
      <!--侧边导航栏结束-->
      <div class="main_right">
        <div class="tit">
            <h3>我的留言</h3>
        </div>
        <div class="main_cont">
            <div class="explain">
                <p>说明：已通过的留言不支持修改.</p>
            </div>
            <table class="tablelist">
                <thead>
                    <tr>
                        <th width="50%">留言内容</th>
                        <th width="20%">留言时间</th>
                        <th width="10%">状态</th>
                        <th width="15%">操作</th>
                    </tr>
                </thead>
                <tbody>
                    {foreach $feedback as $val}
                    <tr>
                        <td title="{$val.content}" style="overflow: hidden; max-width:200px; white-space:nowrap; text-overflow:ellipsis;">{$val.content}</td>
                        <td>{:date("Y/m/d H:i:s",$val.create_time)}</td>
                        <td class="td-status">
                            {if condition="$val.status eq '已读'"}
							<span class="label-success radius">{$val.status}</span>
							{else /}
							<span class="label radius">{$val.status}</span>
							{/if}
                            </td>
                        <td class="td-manage">
                            {if condition="$val.status eq '已读'"}
                            <a title="删除" href="javascript:;" data-name="" data-id="{$val.id}" class="del">删除</a>
                            {else /}
                            <a title="修改" href="javascript:;" onClick="feedback_stop(this,'{$val.id}','{$val.content}')" data-name="" class="modify">修改</a>
							<a title="删除" href="javascript:;" data-name="" data-id="{$val.id}" class="del">删除</a>
							{/if}	
                            </td>
                        </tr>
                        {/foreach}
                </tbody>
            </table>
            <div id="page"><span class="pageinfo">共{$feedback->count('id')}条记录</span></div>
        </div>
    </div>
</div>
<!--底部开始-->
{include file='member_temp/user/footer'}
<!--底部结束-->
  <!--列表状态样式开始-->
<style>
.label-success,.badge-success {display: inline-block;
	padding: 2px 4px;
	font-size: 11.844px;
	font-weight: bold;
	line-height: 14px;
	color: #fff;
	white-space: nowrap;
	vertical-align: middle;
	background-color: #5eb95e;
    overflow: hidden;
    border-radius: 3px;
}
.label-danger,.badge-success {display: inline-block;
	padding: 2px 4px;
	font-size: 11.844px;
	font-weight: bold;
	line-height: 14px;
	color: #fff;
	white-space: nowrap;
	vertical-align: middle;
	background-color: #dd514c;
    overflow: hidden;
    border-radius: 3px;
}
.label.radius {border-radius: 3px;}
.label,.badge {
	display: inline-block;
	padding: 2px 4px;
	font-size: 11.844px;
	font-weight: bold;
	line-height: 14px;
	color: #fff;
	white-space: nowrap;
	vertical-align: middle;
	background-color: #999;
	overflow: hidden
}
</style>
<!--列表状态样式结束-->
<script>
        //删除操作
		$(".del").click(function() {
			//获取删除信息和对应id
			var name = $(this).attr('data-name');
			var id = $(this).attr('data-id');
			layer.msg('是否删除?', {
				time: 5000, //5s后自动关闭
				shade: 0.3,
				btn: ['删除', '取消'],
				yes: function() {
					//执行删除
					$.post("{:url('User/feedback_del')}", {
						ids: id
					}, function(data) {
						layer.msg(data.msg, {
							time: 2000
						}, function() {
							if (data.url) location.href = data.url;
							location.reload();
						});
					})
				}
			});
		})
		
		//修改
		function feedback_stop(obj,id,com){
		    layer.prompt({
                  formType: 2,
                  value: com,
                  title: '评论修改：',
                  maxlength: 100,//最大输入字数
                  scrollbar: false,//屏蔽滚动条
                  area: ['300px', '150px'] //自定义文本域宽高
                }, function(value, index, elem){
                    //console.log(alert(value));
                    $.post("{:url('User/feedback_modify')}",{id:id,content:value},function(data){
                        layer.msg(data.msg,{time:3000},function(){
                            if(data.url) location.href=data.url;
                            location.reload();
                        });
                    });
                });
		}
</script>
</body></html>